/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainMenu.java
 *
 * Created on Dec 14, 2011, 1:41:26 PM
 */
package com.ivanbiz.gui;

import com.birosoft.liquid.LiquidLookAndFeel;
import com.ivanbiz.dao.JenisDAO;
import com.ivanbiz.dao.JenisPUUDAO;
import com.ivanbiz.dao.KabPropDAO;
import com.ivanbiz.helper.RightRenderer;
import com.ivanbiz.impl.JenisDAOImpl;
import com.ivanbiz.impl.JenisPUUDAOImpl;
import com.ivanbiz.impl.KabPropDAOImpl;
import com.ivanbiz.model.Jenis;
import com.ivanbiz.model.JenisPUU;
import com.ivanbiz.model.KabProp;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

/**
 *
 * @author Ivan
 */
public class MainMenu extends javax.swing.JFrame {

    private List listJenis = new ArrayList();
    private List<JenisPUU> listJenisPUU = new ArrayList<JenisPUU>();
    private List<JenisPUU> listJenisPUUTahun = new ArrayList<JenisPUU>();
    private List<JenisPUU> listJenisPUUKabProp = new ArrayList<JenisPUU>();
    private List listKabupaten = new ArrayList();
    private List listPropinsi = new ArrayList();
    private JenisPUUDAO jenisPUUDAO = new JenisPUUDAOImpl();
    private JenisDAO jenisDAO = new JenisDAOImpl();
    private KabPropDAO kabPropDAO = new KabPropDAOImpl();
    String path;
    String imageHeader;
    String imageFooter;
    String imageCari;
    String imageKeluar;

    /** Creates new form MainMenu */
    public MainMenu() {
        initComponents();
        updateData();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dialogTambahPeraturan = new javax.swing.JDialog();
        jPanel7 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        textInputNomor = new javax.swing.JTextField();
        textInputTahun = new javax.swing.JTextField();
        textInputTentang = new javax.swing.JTextField();
        textInputNamaFile = new javax.swing.JTextField();
        comboInputJenisPUU = new javax.swing.JComboBox();
        comboInputPropinsi = new javax.swing.JComboBox();
        comboInputKabupaten = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        buttonAdd = new javax.swing.JButton();
        buttonUpdate = new javax.swing.JButton();
        buttonDelete = new javax.swing.JButton();
        buttonReset = new javax.swing.JButton();
        buttonKeluar = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tableDataPeraturan = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        labelHeader = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tablePeraturan = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        buttonSemuaPeraturan = new javax.swing.JButton();
        buttonUndangUndang = new javax.swing.JButton();
        buttonPERPU = new javax.swing.JButton();
        buttonPeraturanPemerintah = new javax.swing.JButton();
        buttonPeraturanPresiden = new javax.swing.JButton();
        buttonKeputusanPresiden = new javax.swing.JButton();
        buttonInstruksiPresiden = new javax.swing.JButton();
        buttonPenetapanPresiden = new javax.swing.JButton();
        buttonPeraturanMendagri = new javax.swing.JButton();
        buttonKeputusanMendagri = new javax.swing.JButton();
        buttonInstruksiMendagri = new javax.swing.JButton();
        buttonSEMendagri = new javax.swing.JButton();
        buttonPerdaPropinsi = new javax.swing.JButton();
        buttonPerdaKabupaten = new javax.swing.JButton();
        buttonTambahPeraturan = new javax.swing.JButton();
        buttonKeluarProgram = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        textNomor = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        comboTahunAwal = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        comboTahunAkhir = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        textTentang = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        comboProp = new javax.swing.JComboBox();
        buttonCari = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        comboKab = new javax.swing.JComboBox();
        jPanel6 = new javax.swing.JPanel();
        labelFooter = new javax.swing.JLabel();

        dialogTambahPeraturan.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dialogTambahPeraturan.setTitle("Tambah Peraturan");
        dialogTambahPeraturan.setModal(true);

        jPanel7.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jPanel8.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel10.setText("Nama File");

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel8.setText("Tentang");

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel9.setText("Tahun");

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel7.setText("Nomor");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Jenis Peraturan");

        textInputNomor.setFont(new java.awt.Font("Tahoma", 1, 11));

        textInputTahun.setFont(new java.awt.Font("Tahoma", 1, 11));

        textInputTentang.setFont(new java.awt.Font("Tahoma", 1, 11));

        textInputNamaFile.setFont(new java.awt.Font("Tahoma", 1, 11));

        comboInputJenisPUU.setFont(new java.awt.Font("Tahoma", 1, 11));
        comboInputJenisPUU.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboInputJenisPUUActionPerformed(evt);
            }
        });

        comboInputPropinsi.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        comboInputKabupaten.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel11.setText("Propinsi");

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel12.setText("Kabupaten");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel7)
                    .addComponent(jLabel9)
                    .addComponent(jLabel8)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(comboInputPropinsi, javax.swing.GroupLayout.Alignment.TRAILING, 0, 568, Short.MAX_VALUE)
                    .addComponent(textInputNomor, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
                    .addComponent(textInputTahun, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
                    .addComponent(textInputTentang, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addComponent(comboInputJenisPUU, 0, 350, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(textInputNamaFile, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(comboInputKabupaten, javax.swing.GroupLayout.Alignment.TRAILING, 0, 568, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(comboInputJenisPUU, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textInputNamaFile, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textInputNomor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textInputTahun, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textInputTentang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboInputPropinsi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addGap(6, 6, 6)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(comboInputKabupaten, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        buttonAdd.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonAdd.setText("Tambah");
        buttonAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAddActionPerformed(evt);
            }
        });

        buttonUpdate.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonUpdate.setText("Edit");
        buttonUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonUpdateActionPerformed(evt);
            }
        });

        buttonDelete.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonDelete.setText("Hapus");
        buttonDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonDeleteActionPerformed(evt);
            }
        });

        buttonReset.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonReset.setText("Reset");
        buttonReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonResetActionPerformed(evt);
            }
        });

        buttonKeluar.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonKeluar.setText("Keluar");
        buttonKeluar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonKeluarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addComponent(buttonAdd, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(buttonKeluar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                            .addComponent(buttonReset, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                            .addComponent(buttonDelete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                            .addComponent(buttonUpdate, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
                        .addGap(11, 11, 11))))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonAdd)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonUpdate)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonDelete)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonReset)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonKeluar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        tableDataPeraturan.setAutoCreateRowSorter(true);
        tableDataPeraturan.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        tableDataPeraturan.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tableDataPeraturan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tableDataPeraturanMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tableDataPeraturan);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 792, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel9, 0, 182, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dialogTambahPeraturanLayout = new javax.swing.GroupLayout(dialogTambahPeraturan.getContentPane());
        dialogTambahPeraturan.getContentPane().setLayout(dialogTambahPeraturanLayout);
        dialogTambahPeraturanLayout.setHorizontalGroup(
            dialogTambahPeraturanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        dialogTambahPeraturanLayout.setVerticalGroup(
            dialogTambahPeraturanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Himpunan Peraturan Bidang Pemerintahan Daerah ");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(labelHeader, javax.swing.GroupLayout.DEFAULT_SIZE, 1109, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(labelHeader, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        tablePeraturan.setAutoCreateRowSorter(true);
        tablePeraturan.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        tablePeraturan.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tablePeraturan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tablePeraturanMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tablePeraturan);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 898, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        buttonSemuaPeraturan.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonSemuaPeraturan.setText("Semua Peraturan");
        buttonSemuaPeraturan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSemuaPeraturanActionPerformed(evt);
            }
        });

        buttonUndangUndang.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonUndangUndang.setText("Undang - Udang");
        buttonUndangUndang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonUndangUndangActionPerformed(evt);
            }
        });

        buttonPERPU.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPERPU.setText("PERPU");
        buttonPERPU.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPERPUActionPerformed(evt);
            }
        });

        buttonPeraturanPemerintah.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPeraturanPemerintah.setText("Peraturan Pemerintah");
        buttonPeraturanPemerintah.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPeraturanPemerintahActionPerformed(evt);
            }
        });

        buttonPeraturanPresiden.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPeraturanPresiden.setText("Peraturan Presiden");
        buttonPeraturanPresiden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPeraturanPresidenActionPerformed(evt);
            }
        });

        buttonKeputusanPresiden.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonKeputusanPresiden.setText("Keputusan Presiden");
        buttonKeputusanPresiden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonKeputusanPresidenActionPerformed(evt);
            }
        });

        buttonInstruksiPresiden.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonInstruksiPresiden.setText("Instruksi Presiden");
        buttonInstruksiPresiden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonInstruksiPresidenActionPerformed(evt);
            }
        });

        buttonPenetapanPresiden.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPenetapanPresiden.setText("Penetapan Presiden");
        buttonPenetapanPresiden.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPenetapanPresidenActionPerformed(evt);
            }
        });

        buttonPeraturanMendagri.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPeraturanMendagri.setText("Peraturan Mendagri");
        buttonPeraturanMendagri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPeraturanMendagriActionPerformed(evt);
            }
        });

        buttonKeputusanMendagri.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonKeputusanMendagri.setText("Keputusan Mendagri");
        buttonKeputusanMendagri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonKeputusanMendagriActionPerformed(evt);
            }
        });

        buttonInstruksiMendagri.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonInstruksiMendagri.setText("Instruksi Mendagri");
        buttonInstruksiMendagri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonInstruksiMendagriActionPerformed(evt);
            }
        });

        buttonSEMendagri.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonSEMendagri.setText("SE Mendagri");
        buttonSEMendagri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSEMendagriActionPerformed(evt);
            }
        });

        buttonPerdaPropinsi.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPerdaPropinsi.setText("Perda Propinsi");
        buttonPerdaPropinsi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPerdaPropinsiActionPerformed(evt);
            }
        });

        buttonPerdaKabupaten.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonPerdaKabupaten.setText("Perda Kabupaten");
        buttonPerdaKabupaten.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonPerdaKabupatenActionPerformed(evt);
            }
        });

        buttonTambahPeraturan.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        buttonTambahPeraturan.setText("Tambah Peraturan");
        buttonTambahPeraturan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTambahPeraturanActionPerformed(evt);
            }
        });

        buttonKeluarProgram.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonKeluarProgram.setText("Keluar Program");
        buttonKeluarProgram.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonKeluarProgramActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(buttonPerdaPropinsi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonSEMendagri, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonKeputusanMendagri, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPeraturanMendagri, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonSemuaPeraturan, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonUndangUndang, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPERPU, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPeraturanPemerintah, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPeraturanPresiden, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonKeputusanPresiden, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonInstruksiPresiden, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPenetapanPresiden, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 144, Short.MAX_VALUE)
                    .addComponent(buttonInstruksiMendagri, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(buttonPerdaKabupaten, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                    .addComponent(buttonTambahPeraturan, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonKeluarProgram, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonSemuaPeraturan)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonUndangUndang)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPERPU)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPeraturanPemerintah)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPeraturanPresiden)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonKeputusanPresiden)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonInstruksiPresiden)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPenetapanPresiden)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPeraturanMendagri)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonKeputusanMendagri)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonInstruksiMendagri)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonSEMendagri)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPerdaPropinsi)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonPerdaKabupaten)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonTambahPeraturan)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonKeluarProgram)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        textNomor.setFont(new java.awt.Font("Tahoma", 1, 11));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Nomor");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setText("Tahun");

        comboTahunAwal.setFont(new java.awt.Font("Tahoma", 1, 11));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel4.setText("s/d");

        comboTahunAkhir.setFont(new java.awt.Font("Tahoma", 1, 11));

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel5.setText("Tentang");

        textTentang.setFont(new java.awt.Font("Tahoma", 1, 11));

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel6.setText("Prop");

        comboProp.setFont(new java.awt.Font("Tahoma", 1, 11));
        comboProp.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        buttonCari.setFont(new java.awt.Font("Tahoma", 1, 11));
        buttonCari.setText("Cari");
        buttonCari.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCariActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setText("Kab");

        comboKab.setFont(new java.awt.Font("Tahoma", 1, 11));
        comboKab.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textNomor, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboTahunAwal, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboTahunAkhir, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textTentang, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboProp, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboKab, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCari, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(textNomor)
                            .addComponent(textTentang, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(comboTahunAwal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(comboTahunAkhir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)))
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(buttonCari, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(comboKab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6)
                        .addComponent(comboProp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(labelFooter, javax.swing.GroupLayout.DEFAULT_SIZE, 918, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(labelFooter, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-1125)/2, (screenSize.height-630)/2, 1125, 630);
    }// </editor-fold>//GEN-END:initComponents

    private void buttonSemuaPeraturanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSemuaPeraturanActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getAll(JenisPUU.class);
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonSemuaPeraturanActionPerformed

    private void buttonUndangUndangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUndangUndangActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Undang-Undang");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonUndangUndangActionPerformed

    private void buttonPERPUActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPERPUActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "PERPU");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPERPUActionPerformed

    private void buttonPeraturanPemerintahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPeraturanPemerintahActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Peraturan Pemerintah");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPeraturanPemerintahActionPerformed

    private void buttonPeraturanPresidenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPeraturanPresidenActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Peraturan Presiden");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPeraturanPresidenActionPerformed

    private void buttonKeputusanPresidenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonKeputusanPresidenActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Keputusan Presiden");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonKeputusanPresidenActionPerformed

    private void buttonInstruksiPresidenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonInstruksiPresidenActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Instruksi Presiden");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonInstruksiPresidenActionPerformed

    private void buttonPenetapanPresidenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPenetapanPresidenActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Penetapan Presiden");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPenetapanPresidenActionPerformed

    private void buttonPerdaKabupatenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPerdaKabupatenActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Perda Kabupaten");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPerdaKabupatenActionPerformed

    private void buttonPerdaPropinsiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPerdaPropinsiActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Perda Propinsi");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPerdaPropinsiActionPerformed

    private void buttonSEMendagriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSEMendagriActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "SE Mendagri");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonSEMendagriActionPerformed

    private void buttonInstruksiMendagriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonInstruksiMendagriActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Instruksi Mendagri");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonInstruksiMendagriActionPerformed

    private void buttonKeputusanMendagriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonKeputusanMendagriActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Keputusan Mendagri");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonKeputusanMendagriActionPerformed

    private void buttonPeraturanMendagriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPeraturanMendagriActionPerformed
        try {
            listJenisPUU = jenisPUUDAO.getDataByEquals(JenisPUU.class, "jenis", "Peraturan Mendagri");
            updateTabelPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonPeraturanMendagriActionPerformed

    private void buttonCariActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCariActionPerformed
        try {
            if (comboTahunAwal.getSelectedItem() == null || comboTahunAwal.getSelectedItem() == null) {
                JOptionPane.showMessageDialog(null, "Tahun harus dipilih");
            } else {
                String prop = comboProp.getSelectedItem().toString();
                String kab = comboKab.getSelectedItem().toString();
                if (prop.equals("") && !kab.equals("")) {
                    System.out.println("masuk");
                    prop = comboKab.getSelectedItem().toString();
                } else if (kab.equals("") && !prop.equals("")) {
                    System.out.println("keluar");
                    kab = comboProp.getSelectedItem().toString();
                }
                listJenisPUU = jenisPUUDAO.getDataByLike(JenisPUU.class, textNomor.getText(), comboTahunAwal.getSelectedItem().toString(), comboTahunAkhir.getSelectedItem().toString(), textTentang.getText(), prop, kab);
                updateTabelPeraturan();
            }
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
}//GEN-LAST:event_buttonCariActionPerformed

    private void buttonTambahPeraturanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonTambahPeraturanActionPerformed
        try {
            dialogTambahPeraturan.setSize(800, 600);
            dialogTambahPeraturan.setLocationRelativeTo(null);
            updateDataDialog();
            dialogTambahPeraturan.setVisible(true);
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_buttonTambahPeraturanActionPerformed

    private void tablePeraturanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablePeraturanMouseClicked
        try {
            if (evt.getClickCount() == 2 && SwingUtilities.isLeftMouseButton(evt)) {
                JenisPUU jenisPUU = (JenisPUU) listJenisPUU.get(tablePeraturan.getSelectedRow());
                String openFile = "cmd /c start " + path + jenisPUU.getNamaFile();
                Runtime.getRuntime().exec(openFile);
            }
        } catch (IOException ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_tablePeraturanMouseClicked

    private void buttonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddActionPerformed
        try {
            JenisPUU jenisPUU = new JenisPUU();
            jenisPUU.setJenis(comboInputJenisPUU.getSelectedItem().toString());
            jenisPUU.setNomor(textInputNomor.getText());
            jenisPUU.setTahun(textInputTahun.getText());
            jenisPUU.setJudulPeraturan(textInputTentang.getText());
            if (comboInputJenisPUU.getSelectedItem().equals("Perda Propinsi")) {
                jenisPUU.setKabProp(comboInputPropinsi.getSelectedItem().toString());
            } else if (comboInputJenisPUU.getSelectedItem().equals("Perda Kabupaten")) {
                jenisPUU.setKabProp(comboInputKabupaten.getSelectedItem().toString());
            } else {
                jenisPUU.setKabProp("");
            }
            jenisPUU.setNamaFile(textInputNamaFile.getText());
            jenisPUUDAO.save(jenisPUU);
            updateDataDialog();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_buttonAddActionPerformed

    private void tableDataPeraturanMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableDataPeraturanMouseClicked
        try {
            if (evt.getClickCount() == 2 && SwingUtilities.isLeftMouseButton(evt)) {
                buttonAdd.setEnabled(false);
                JenisPUU jenisPUU = (JenisPUU) listJenisPUU.get(tableDataPeraturan.getSelectedRow());
                comboInputJenisPUU.setSelectedItem(jenisPUU.getJenis());
                textInputNomor.setText(jenisPUU.getNomor());
                textInputTahun.setText(jenisPUU.getTahun());
                textInputTentang.setText(jenisPUU.getJudulPeraturan());
                comboInputPropinsi.setSelectedItem(jenisPUU.getKabProp());
                comboInputKabupaten.setSelectedItem(jenisPUU.getKabProp());
                textInputNamaFile.setText(jenisPUU.getNamaFile());
            }
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_tableDataPeraturanMouseClicked

    private void buttonUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUpdateActionPerformed
        try {
            JenisPUU jenisPUU = (JenisPUU) listJenisPUU.get(tableDataPeraturan.getSelectedRow());
            jenisPUU.setJenis(comboInputJenisPUU.getSelectedItem().toString());
            jenisPUU.setNomor(textInputNomor.getText());
            jenisPUU.setTahun(textInputTahun.getText());
            jenisPUU.setJudulPeraturan(textInputTentang.getText());
            if (comboInputJenisPUU.getSelectedItem().equals("Perda Propinsi")) {
                jenisPUU.setKabProp(comboInputPropinsi.getSelectedItem().toString());
            } else if (comboInputJenisPUU.getSelectedItem().equals("Perda Kabupaten")) {
                jenisPUU.setKabProp(comboInputKabupaten.getSelectedItem().toString());
            } else {
                jenisPUU.setKabProp("");
            }
            jenisPUU.setNamaFile(textInputNamaFile.getText());
            jenisPUUDAO.update(jenisPUU);
            updateDataDialog();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_buttonUpdateActionPerformed

    private void buttonDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDeleteActionPerformed
        try {
            JenisPUU jenisPUU = (JenisPUU) listJenisPUU.get(tableDataPeraturan.getSelectedRow());
            jenisPUUDAO.delete(jenisPUU);
            updateDataDialog();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_buttonDeleteActionPerformed

    private void buttonKeluarProgramActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonKeluarProgramActionPerformed
        System.exit(9);
    }//GEN-LAST:event_buttonKeluarProgramActionPerformed

    private void buttonResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonResetActionPerformed
        try {
            updateDataDialog();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_buttonResetActionPerformed

    private void buttonKeluarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonKeluarActionPerformed
        dialogTambahPeraturan.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dialogTambahPeraturan.setVisible(false);
    }//GEN-LAST:event_buttonKeluarActionPerformed

    private void comboInputJenisPUUActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboInputJenisPUUActionPerformed
        if (comboInputJenisPUU.getSelectedItem().equals("Perda Propinsi")) {
            comboInputPropinsi.setEnabled(true);
        } else {
            comboInputPropinsi.setEnabled(false);
        }
        if (comboInputJenisPUU.getSelectedItem().equals("Perda Kabupaten")) {
            comboInputKabupaten.setEnabled(true);
        } else {
            comboInputKabupaten.setEnabled(false);
        }
    }//GEN-LAST:event_comboInputJenisPUUActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try {
                    LiquidLookAndFeel.setLiquidDecorations(true, "mac");
                    UIManager.setLookAndFeel(new LiquidLookAndFeel());
                    new MainMenu().setVisible(true);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonAdd;
    private javax.swing.JButton buttonCari;
    private javax.swing.JButton buttonDelete;
    private javax.swing.JButton buttonInstruksiMendagri;
    private javax.swing.JButton buttonInstruksiPresiden;
    private javax.swing.JButton buttonKeluar;
    private javax.swing.JButton buttonKeluarProgram;
    private javax.swing.JButton buttonKeputusanMendagri;
    private javax.swing.JButton buttonKeputusanPresiden;
    private javax.swing.JButton buttonPERPU;
    private javax.swing.JButton buttonPenetapanPresiden;
    private javax.swing.JButton buttonPeraturanMendagri;
    private javax.swing.JButton buttonPeraturanPemerintah;
    private javax.swing.JButton buttonPeraturanPresiden;
    private javax.swing.JButton buttonPerdaKabupaten;
    private javax.swing.JButton buttonPerdaPropinsi;
    private javax.swing.JButton buttonReset;
    private javax.swing.JButton buttonSEMendagri;
    private javax.swing.JButton buttonSemuaPeraturan;
    private javax.swing.JButton buttonTambahPeraturan;
    private javax.swing.JButton buttonUndangUndang;
    private javax.swing.JButton buttonUpdate;
    private javax.swing.JComboBox comboInputJenisPUU;
    private javax.swing.JComboBox comboInputKabupaten;
    private javax.swing.JComboBox comboInputPropinsi;
    private javax.swing.JComboBox comboKab;
    private javax.swing.JComboBox comboProp;
    private javax.swing.JComboBox comboTahunAkhir;
    private javax.swing.JComboBox comboTahunAwal;
    private javax.swing.JDialog dialogTambahPeraturan;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel labelFooter;
    private javax.swing.JLabel labelHeader;
    private javax.swing.JTable tableDataPeraturan;
    private javax.swing.JTable tablePeraturan;
    private javax.swing.JTextField textInputNamaFile;
    private javax.swing.JTextField textInputNomor;
    private javax.swing.JTextField textInputTahun;
    private javax.swing.JTextField textInputTentang;
    private javax.swing.JTextField textNomor;
    private javax.swing.JTextField textTentang;
    // End of variables declaration//GEN-END:variables

    private void updateComboJenis() {
        Object data[] = new Object[listJenis.size()];
        for (int x = 0; x < listJenis.size(); x++) {
            Jenis jenis = (Jenis) listJenis.get(x);
            data[x] = jenis.getNama();
            List list = Arrays.asList(data[x]);
            Collections.sort(list);
        }
        comboInputJenisPUU.setModel(new DefaultComboBoxModel(data));
    }

    private void updateComboKabupaten() {
        KabProp kabProp = new KabProp();
        kabProp.setKab("");
        listKabupaten.add(0, kabProp);
        Object data[] = new Object[listKabupaten.size()];
        for (int x = 0; x < listKabupaten.size(); x++) {
            kabProp = (KabProp) listKabupaten.get(x);
            data[x] = kabProp.getKab();
        }
        comboInputKabupaten.setModel(new DefaultComboBoxModel(data));
        comboKab.setModel(new DefaultComboBoxModel(data));
    }

    private void updateComboPropinsi() {
        listPropinsi.add(0, "");
        Object data[] = new Object[listPropinsi.size()];
        for (int x = 0; x < listPropinsi.size(); x++) {
            data[x] = listPropinsi.get(x);
        }
        comboInputPropinsi.setModel(new DefaultComboBoxModel(data));
        comboProp.setModel(new DefaultComboBoxModel(data));
    }
    // End of variables declaration

    private void updateData() {
        try {
            File file = new File("config.properties");
            FileInputStream fis = new FileInputStream(file.getAbsolutePath());
            InputStreamReader reader = new InputStreamReader(fis, Charset.forName("UTF-8"));
            ResourceBundle rb = new PropertyResourceBundle(reader);
            String str = file.getAbsolutePath().substring(0, file.getAbsolutePath().indexOf("config.properties"));
            String strImage = str + "image\\";
            String strPath = str + "doc\\";
            path = strPath;
            imageHeader = strImage + rb.getString("imageHeader").trim();
            imageFooter = strImage + rb.getString("imageFooter").trim();
            labelHeader.setIcon(new javax.swing.ImageIcon(imageHeader));
            labelFooter.setIcon(new javax.swing.ImageIcon(imageFooter));
            //buttonSemuaPeraturan.setIcon(new javax.swing.ImageIcon(imageCari));
            //buttonTambahPeraturan.setIcon(new javax.swing.ImageIcon(imageKeluar));
            listJenisPUUTahun = jenisPUUDAO.getGroupByEquals(JenisPUU.class, "tahun");
            updateTahun();
            listPropinsi = kabPropDAO.getGroupByEquals(KabProp.class, "propinsi");
            updateComboPropinsi();
            listKabupaten = kabPropDAO.getAll(KabProp.class);
            updateComboKabupaten();
            listJenisPUU = jenisPUUDAO.getAll(JenisPUU.class);
            updateTabelPeraturan();
        //updateTabelDataPeraturan();
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void updateDataDialog() {
        try {
            textInputNomor.setText("");
            textInputNamaFile.setText("");
            textInputTahun.setText("");
            textInputTentang.setText("");
            buttonAdd.setEnabled(true);
            listJenisPUU = jenisPUUDAO.getAll(JenisPUU.class);
            updateTabelPeraturan();
            listJenis = jenisDAO.getAll(Jenis.class);
            updateComboJenis();
            listPropinsi = kabPropDAO.getGroupByEquals(KabProp.class, "propinsi");
            updateComboPropinsi();
            listKabupaten = kabPropDAO.getAll(KabProp.class);
            updateComboKabupaten();
            comboInputKabupaten.setEnabled(false);
            comboInputPropinsi.setEnabled(false);
        } catch (Exception ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void updateKabProp() {
        Object data[] = new Object[listJenisPUUKabProp.size()];
        for (int x = 0; x < listJenisPUUKabProp.size(); x++) {
            data[x] = listJenisPUUKabProp.get(x);
        }
        comboProp.setModel(new DefaultComboBoxModel(data));
    }

    // End of variables declaration
    private void updateTahun() {
        Object data[] = new Object[listJenisPUUTahun.size()];
        for (int x = 0; x < listJenisPUUTahun.size(); x++) {
            data[x] = listJenisPUUTahun.get(x);
        }
        comboTahunAwal.setModel(new DefaultComboBoxModel(data));
        comboTahunAkhir.setModel(new DefaultComboBoxModel(data));
    }

    private void updateTabelPeraturan() {
        String[] judul = {"Jenis Peraturan", "Nomor", "Tahun", "Tentang", "Kabupaten/Propinsi"};
        Object[][] isi = new Object[listJenisPUU.size()][5];
        int x = 0;
        for (JenisPUU jenisPUU : listJenisPUU) {
            isi[x][0] = jenisPUU.getJenis();
            isi[x][1] = jenisPUU.getNomor();
            isi[x][2] = jenisPUU.getTahun();
            isi[x][3] = jenisPUU.getJudulPeraturan();
            isi[x][4] = jenisPUU.getKabProp();
            x++;
        }
        tablePeraturan.setModel(new DefaultTableModel(isi, judul) {

            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return false;
            }
        });
        tableDataPeraturan.setModel(new DefaultTableModel(isi, judul) {

            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return false;
            }
        });
        updateTable(tablePeraturan);
        updateTable(tableDataPeraturan);

    }

    private void updateTable(JTable column) {
        TableColumn column1 = column.getColumnModel().getColumn(0);
        column1.setPreferredWidth(150);
        column1.setMaxWidth(150);
        TableColumn column2 = column.getColumnModel().getColumn(1);
        column2.setPreferredWidth(75);
        column2.setMaxWidth(75);
        column2.setCellRenderer(new RightRenderer());
        TableColumn column3 = column.getColumnModel().getColumn(2);
        column3.setPreferredWidth(75);
        column3.setMaxWidth(75);
        TableColumn column5 = column.getColumnModel().getColumn(4);
        column5.setPreferredWidth(170);
        column5.setMaxWidth(250);
    }
}
